import { spawn } from 'node:child_process'

// 执行 Python 脚本
const pythonProcess = spawn('python', ['../python/main.py'])

pythonProcess.stdout.on('data', (data) => {
  console.log(`stdout: ${data}`)
})

pythonProcess.stderr.on('data', (data) => {
  console.error(`stderr: ${data}`)
})

pythonProcess.on('close', (code) => {
  console.log(`child process exited with code ${code}`)
})